package book.crawler.bookText;


import book.crawler.utils.HttpUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class test {
  private final static Logger logger = LoggerFactory.getLogger(BookCrawler.class);
    @Test
    public void test() {
        String url = "https://www.ireader.com.cn/index.php?ca=booksort.index&pca=booksort.index&pid=10";
        logger.info("------------开始爬取!!!------------");
        String html = HttpUtils.getHtml(url);//爬取分类首页
        Document doc = Jsoup.parse(html);
        Elements elements = doc.select("[data-id]");
        for (Element e:elements) {
            System.out.println(e);
        }

    }
}
